#include <iostream>
#include <string>
#define B 131
using namespace std;



int main(){
	string s;
	cin>>s;
	unsigned long long h1[s.length()],h2[s.length()];
	h1[0] = s[0];
	h2[s.length()-1] = s[s.length()-1];
	unsigned long long powb[s.length()+1];
	powb[0] = 1;
	powb[1] = B;
	for(int i=1;i<s.length();i++){
		powb[i+1] = powb[i]*B;
		h1[i] = h1[i-1]*B+s[i];
		h2[s.length()-i-1] = h2[s.length()-i]*B+s[s.length()-i-1];
	}
	
	
	int q;
	cin>>q;
	for(int t=0;t<q;t++){
		int l,r;
		cin>>l>>r;
//		if(l == r){
//			cout<<"YES"<<endl;
//			continue;
//		}
		l--;
		r--;
		int a,b;
		
		
		if(l == 0)
			a = h1[l+(r-l+1)/2];
		else
			a = h1[l+(r-l+1)/2]-h1[l-1]*powb[(r-l+1)/2+1];
		
		
		if(r == s.length()-1)
			b = h2[r-(r-l+1)/2];
		else
			b = h2[r-(r-l+1)/2]-h2[r+1]*powb[(r-l+1)/2+1];
		
		
		if(a == b)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}
